package day_2022_7_to_8.day48;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author haomin
 * @date 2022/08/16 11:24
 **/
public class Day31_1_Num1656_OrderedStream {
    class OrderedStream {
        String[] ss = new String[1024];
        int id, num;
        public OrderedStream(int n) {
            Arrays.fill(ss,"");
            id = 1;num = n;
        }

        public List<String> insert(int idKey, String value) {
            ss[idKey] = value;
            List<String> res = new ArrayList<>();
            while(ss[id].length() == 5){
                res.add(ss[id++]);
            }
            return res;
        }
    }
}